package com.nook.common.vo.result;

import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
public class Result<T> {
    /**
     * 返回code
     */
    private String code;
    /**
     * 消息message
     */
    private String message;
    /**
     * 返回数据
     */
    private T data;

    public Result(){

    }

    public Result(String code,String message){
        this.code = code;
        this.message = message;
    }

    public Result(String code,String message,T data){
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public static <T> Result<T> success() {
        return new Result<T>("100", "成功");
    }
    public static <T> Result<T> success(T data) {
        return new Result<T>("100", "成功");
    }

}
